<?php
	require_once('../webroot/js/clsMsDocGenerator.php');	
		
	$doc = new clsMsDocGenerator();
	
	$doc->setFontFamily('Arial');
	$doc->setFontSize('11');

	$doc->addParagraph('REPORTE CANASTAS', array('text-align' => 'center','font-weight' => 'bold'));
	$doc->addParagraph('CORPORACI&Oacute;N INFANCIA Y DESARROLLO',array('font-weight' => 'bold'));		
	$doc->addParagraph('ENTIDAD TERRITORIAL: '.$entidades,array('font-weight' => 'bold'));
	$doc->addParagraph('FECHA: '.$fecha,array('font-weight' => 'bold'));
	
	$doc->addParagraph('');
		
	 //Tabla
	    $doc->startTable(NULL, 'tableWithoutGrid');
		$header = array('Nombre Intitucion Educativa', 'Canastas Implementadas en Aula','Otras');
		$aligns = array('center', 'center', 'center');
		$valigns = array('middle', 'middle', 'middle');
		$doc->addTableRow($header, $aligns, $valigns, array('font-weight' => 'normal', 'font-size' => '11pt', 
														'background-color' => '#9F9F9F', 'color'=>'white'));
		$i=0;
        foreach ($canastas_datos  as &$canasta){		    
     	    	$cols = array();	
				$cols[]=$canastas[$i]['nombre'];	
				$cols[]=$canasta['Canasta']['cantidad_inplementacion'];
				$cols[]=($canastas[$i]['Canasta']['uso']-$canastas[$i]['Canasta']['implementadas'])+$canastas[$i]['Canasta']['almacenadas'];	
				$i++;
				$doc->addTableRow($cols, NULL, NULL, array('font-size' => '10pt'));	
		}
	    $doc->endTable();  
	         
	    $doc->addParagraph('');
	    $doc->addParagraph('');

	    //Tabla	 
			$doc->startTable(NULL, 'tableWithoutGrid');
			$header = array('Total Canastas: '.$cols[]=$canastas['total']);
		$aligns = array('left');
		$valigns = array('middle');		    
     	
		$doc->addTableRow($header, $aligns, $valigns, array('font-weight' => 'normal', 'font-size' => '11pt', 
														'background-color' => '#9F9F9F', 'color'=>'white'));
	    $doc->endTable(); 	    
	    	    
	$doc->addParagraph('');
	$doc->output('Reporte Canastas('.$entidades.')');
?>